{layout name="public/layout" /}
{include file='yxnavbar'}


<div class="main">
    {include file='game/game_common_nav'}
    <div class="panel panel-info">
        <div class="panel-heading">当前数量： {$page_total}</div>
        <div class="panel-body">
            <form id = "myform" action="./index.php" method="get" class="form-horizontal" role="form">
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="{$_P['m']}" />
                <input type="hidden" name="do" value="{$do}" />
                <input type="hidden" name="op" value="{$ac}" />
                <input type="hidden" name="themeid" value="{$themeid}" />
                <input type="hidden" name="gl_id" value="{$gl_id}" />
                <input type="hidden" name="gb_id" value="{$gb_id}" />

                <div class="form-group">
                    {if count($themelist)>1}
                    <div class="col-xs-12 col-sm-2 col-md-2">
                        <select onchange="submitForm();" class="form-control" name="themeid">
                            {loop $themelist $row}
                            <option value="{$row['id']}" {if $themeid == $row['id'] }selected="selected"{/if}>{$row['id']} - {php echo mb_substr($row['title'],0,8,'utf-8');}</option>
                            {/loop}
                        </select>
                    </div>
                    {else}
                    <input type="hidden" name="themeid" value="{$themeid}" />
                    {/if}
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">关卡</label>
                    <div class="col-sm-9 col-xs-9 col-md-9">
                        <div class="btn-group">
                            {loop $level_user_list  $ad}
                            <a href="/web/index.php?c=site&a=entry&gb_id=-1&themeid={$themeid}&op=user_level_search&do={$do}&m={$_P['m']}&gl_id={$ad['gl_id']}" class="btn {if $ad['gl_id'] == $gl_id}btn-primary{else}btn-default{/if}">{$ad['title']}<span style="color: #ff0000">{$ad['num']}</span></a>
                            {/loop}
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">宝箱类型</label>
                    <div class="col-sm-9 col-xs-9 col-md-9">
                        <div class="btn-group">
                            {loop $box_user_list  $ad}
                            <a href="/web/index.php?c=site&a=entry&gl_id=-1&themeid={$themeid}&op=user_box_search&do={$do}&m={$_P['m']}&gb_id={$ad['gb_id']}" class="btn {if $ad['gb_id'] == $gb_id}btn-primary{else}btn-default{/if}">{$ad['title']}<span style="color: #ff0000">{$ad['num']}</span></a>
                            {/loop}
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">手机号、微信昵称</label>
                    <div class="col-sm-9 col-xs-9 col-md-9">
                        <input class="form-control" name="search_data" placeholder="输入报名手机号或微信昵称" type="text" value="{$_P['search_data']}">
                    </div>
                </div>
                <div class="form-group clearfix">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">浏览时间</label>
                    <div class="col-sm-3 col-lg-3 col-md-3 col-xs-6">
                        {php echo view_form_field_daterange('createtime', array('start' => $start_day, 'end' => $end_day));}
                    </div>
                    <div class="col-sm-3 col-lg-3 col-md-3 col-xs-6">
                        <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                        <input type="hidden" name="__token__" value="{$Request.token}"/>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-5 col-lg-5 col-md-5 col-xs-5">
                        {if $page_total<=5000}
                        <input class="btn btn-default" type="submit" name="export_submit" onclick="jump()" id="export_submit" value="导出EXCEL">
                        {else}
                        <input class="btn btn-default" type="submit" name="export_submit" onclick="jump()" id="export_submit" value="导出EXCEL(1-5000条)">
                        {/if}
                        {if $page_total>5000}
                        <input class="btn btn-default" type="submit" name="export_submit2" onclick="jump()" id="export_submit2" value="导出(5001-10000)">
                        {/if}
                        {if $page_total>10000}
                        <input class="btn btn-default" type="submit" name="export_submit3" onclick="jump()" id="export_submit3" value="导出(10001-15000)">
                        {/if}
                        {if $page_total>15000}
                        <input class="btn btn-default" type="submit" name="export_submit4" onclick="jump()" id="export_submit4" value="导出(15001-20000)">
                        {/if}
                        {if $page_total>20000}
                        <input class="btn btn-default" type="submit" name="export_submit5" onclick="jump()" id="export_submit5" value="导出(20001-25000)">
                        {/if}
                        {if $page_total>25000}
                        <input class="btn btn-default" type="submit" name="export_submit5" onclick="jump()" id="export_submit5" value="导出(25001-30000)">
                        {/if}
                    </div>
                </div>
            </form>
        </div>
    </div>

    <input type="hidden" name="current_ac" id="current_ac" value="{$ac}">


    {if $ac=='user_level' || $ac=='user_level_search'}
    <div class="tab-content">
        <div class="panel panel-default">
            <div class="panel-body table-responsive">
                <table class="table table-hover">
                    <thead class="navbar-inner">
                    <tr>
                        <th style="width: 50px">序号</th>
                        <th >用户昵称</th>
                        <th style="width: 50px">头像</th>
                        <th style="width: 50px">手机号</th>
                        <th style="width: 120px">关卡</th>
                        <th style="width: 100px">关卡类型</th>
                        <th style="width: 80px">关卡类型操作次数</th>
                        <th >奖品名称</th>
<!--                        <th style="width: 80px">奖品图片</th>-->
                        <th >创建时间</th>
                        <th style="width: 80px;text-align: right">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {loop $list $item}
                    <tr>
                        <td>{$item['gul_id']}</td>
                        <td>{$item['nickname']}</td>
                        <td>
                            <a href="{php echo tomedia($item['avatar']);}"  target="_blank" title="查看原图">
                                <img src="{php echo tomedia($item['avatar']);}" style="width: 40px;height: 40px;padding: 1px;">
                            </a>
                        </td>
                        <td>{$item['mobile']}</td>
                        <td>第{$item['sort']}关</td>
                        <td>{if $item['type']=='share'}
                            <span class="label label-success">分享好友</span>
                            {elseif $item['type']=='friend'}
                            <span class="label label-warning">好友到访</span>
                            {else}
                            <span class="label label-danger">转介绍</span>
                            {/if}</td>
                        <td>{$item['type_op_num']}次</td>
                        <td>{$item['name']}</td>
                        <td>{$item['created_at']}</td><td style="text-align:right; overflow:visible;">
                        <td>
                            <a href="{php echo createWebUrl('game', array('op' =>'detail','themeid'=>$themeid,'type'=>'level','uid'=>$item['uid']));}" class="btn btn-warning btn-sm" title="查看通关记录" data-toggle="tooltip" data-placement="top"  return false;"><i class="fa fa-list"> </i></a>
                        </td>
                    </tr>
                    {/loop}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    {/if}
    {if $ac=='user_box_search' || $ac=='user_box'}
    <div class="tab-content">
        <div class="panel panel-default">
            <div class="panel-body table-responsive">
                <table class="table table-hover">
                    <thead class="navbar-inner">
                    <tr>
                        <th style="width: 50px">序号</th>
                        <th style="width: 50px">用户昵称</th>
                        <th style="width: 50px">头像</th>
                        <th style="width: 50px">手机号</th>
                        <th style="width: 120px">宝箱名称</th>
                        <th style="width: 100px">回答问题</th>
                        <th style="width: 80px">奖品名称</th>
                        <th style="width: 80px">创建时间</th>
                        <th style="width: 80px;text-align: right">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {loop $list $item}
                    <tr>
                        <td>{$item['gub_id']}</td>
                        <td>{$item['nickname']}</td>
                        <td>
                            <a href="{php echo tomedia($item['avatar']);}"  target="_blank" title="查看原图">
                                <img src="{php echo tomedia($item['avatar']);}" style="width: 40px;height: 40px;padding: 1px;">
                            </a>
                        </td>
                        <td>{$item['mobile']}</td>
                        <td>{if $item['gb_id']==1}
                            <span class="label label-success">{$item['box_name']}</span>
                            {elseif $item['gb_id']==2}
                            <span class="label label-warning">{$item['box_name']}</span>
                            {else}
                            <span class="label label-danger">{$item['box_name']}</span>
                            {/if}</td>
                        <td>{$item['question']}</td>
                        <td>{$item['name']}</td>
                        <td>{$item['created_at']}</td>
                        <td style="text-align: right">
                            <a href="{php echo createWebUrl('game', array('op' =>'detail','themeid'=>$themeid,'type'=>'level','uid'=>$item['uid']));}" class="btn btn-warning btn-sm" title="查看通关记录" data-toggle="tooltip" data-placement="top"  return false;"><i class="fa fa-list"> </i></a>
                        </td>
                    </tr>
                    {/loop}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    {/if}
</div>
{$pager}
<script type="text/javascript">
    $(document).ready(
        function (){
        }
    );
    function jump(){
        layer.msg('正在准备下载');
    }
    function drop_confirm(msg, url){
        if(confirm(msg)){
            window.location = url;
        }
    }
</script>
